package com.tf8.treasure.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.tf8.treasure.enums.ReturnType;
import lombok.Data;

@Data
@JsonInclude(value= JsonInclude.Include.NON_NULL)
public class ResponseInfo<T> implements java.io.Serializable {
    private int code;
    private String message;
    private T data;

    public ResponseInfo(ReturnType type, T t){
        this.code = type.getCode();
        this.message = type.getMsg();
        this.data = t;
    }
    public ResponseInfo(int code,String msg){
        this.code = code;
        this.message = msg;
    }

    public ResponseInfo(ReturnType type){
        this.code = type.getCode();
        this.message = type.getMsg();
    }
}